package server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
	private ServerSocket serverSocketThread ;
	private Socket socket;
	private int portEcoute;
	
	public Server(){
		portEcoute = 2100;
		demarrer();
	}
	
	public void demarrer(){
		try {
			serverSocketThread = new ServerSocket(portEcoute);
			while(true){
				socket = serverSocketThread.accept();
				Thread threadServeur = new Thread(new ServerThread(socket));
				threadServeur.start();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		Server serverTest = new Server();
	}
}